from common.base_api import BaseApi
from common.utils import Utils
from common.wrapper import api_call


class ActivityApi(BaseApi):
    # ---------------------全链峰NCDA页-------------------------
    @api_call
    def ncda_areaList_api(self):
        """
        NCDA区域列表
        :return:
        """
        api = self.conf_data['api']['activity']['ncda_areaList']
        data = {
            'url': self.host + api,
            'method': 'get',
            'headers': self.headers,
            'params': {}
        }
        response = self.send_http(data)
        return response

    @api_call
    def ncda_school_list_api(self,**kwargs):
        """
        NCDA注册的学校列表
        :return:
        """
        api = self.conf_data['api']['activity']['ncda_school_list']
        data = {
            'url': self.host + api,
            'method': 'get',
            'headers': self.headers,
            'params': {}
        }
        data['params'].update(kwargs)
        response = self.send_http(data)
        return response

    @api_call
    def ncda_creator_list_api(self, **kwargs):
        """
        NCDA创作者列表
        :return:
        """
        api = self.conf_data['api']['activity']['ncda_creator_list']
        data = {
            'url': self.host + api,
            'method': 'get',
            'headers': self.headers,
            'params': {}
        }
        data['params'].update(kwargs)
        response = self.send_http(data)

        return response

    @api_call
    def ncda_product_list_api(self,**kwargs):
        """
        NCDA作品列表
        :return:
        """
        api = self.conf_data['api']['activity']['ncda_product_list']
        data = {
            'url': self.host + api,
            'method': 'get',
            'headers': self.headers,
            'params': {}
        }
        data['params'].update(kwargs)
        response = self.send_http(data)
        return response

    @api_call
    def ncda_sell_well_list_api(self,**kwargs):
        """
        NCDA 热销作品列表
        :return:
        """
        api = self.conf_data['api']['activity']['ncda_sell_well_list']
        data = {
            'url': self.host + api,
            'method': 'get',
            'headers': self.headers,
            'params': {}
        }
        data['params'].update(kwargs)
        response = self.send_http(data)
        return response
